class MyStack {
public:
    deque<int>deq;
    MyStack() {

    }
    
    void push(int x) {
        deq.push_front(x);
        return ;
    }
    
    int pop() {
        int num=deq.front();
        deq.pop_front();
        return num;
    }
    
    int top() {
        return deq.front();
    }
    
    bool empty() {
        return deq.empty();
    }
};
